import request from "@/utils/request";

// 查询角色列表
export function listRole(query) {
  return request({
    url: '/system/role/list',
    method: 'get',
    params: query
  })
}

// 查询角色详细
export function getRole(roleId) {
  return request({
    url: '/system/role/' + roleId,
    method: 'get'
  })
}

// 角色新增
export function addRole(data) {
  return request({
    url: `/system/role/add`,
    method: "post",
    data
  });
}

// 角色停用启用接口
export function changeStatus(data) {
  return request({
    url: `/system/role/changeStatus`,
    method: "put",
    data
  });
}

// 角色修改
export function editRole(data) {
  return request({
    url: `/system/role/edit`,
    method: "post",
    data
  });
}

// 菜单权限管理
export function menuRole(data) {
  return request({
    url: `/system/role/edit/menu`,
    method: "post",
    data
  });
}

// 大屏权限管理
export function screenRole(data) {
  return request({
    url: `/system/role/edit/screen`,
    method: "post",
    data
  });
}

// web菜单授权查询
export function requestwebList(roleId) {
  return request({
    url: `/system/menu/roleMenuTreeselect/menu/${roleId}`,
    method: "get",
  });
}

// 大屏驾驶舱菜单授权查询
export function requestscreenList(roleId) {
  return request({
    url: `/system/menu/roleMenuTreeselect/screen/${roleId}`,
    method: "get",
  });
}

// 删除角色
export function delRole(roleId) {
  return request({
    url: '/system/role/' + roleId,
    method: 'delete'
  })
}

// 查询角色集合
export function getRoleArr() {
  return request({
    url: '/system/user/',
    method: 'get'
  })
}
